﻿using System;
using System.Windows.Data;
using AccessControl.Contracts.Models;
using AccessControl.Gateway.Managers;

namespace AccessControl.Wpf.Converters
{
	class IsCurrentLoggedInOperatorConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			IOperator myOperator = (IOperator)value;
			if (myOperator == null)
				return false;

			if (myOperator.Id == Session.Instance.LoggedInOperator.Id)
				return false;

			return true;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}
